home *** CD-ROM | disk | FTP | other *** search
- Path: megatek.megatek.com!not-for-mail
- From: tpd@kelly.megatek.com (Tim Dietz)
- Newsgroups: comp.lang.c++,comp.unix.questions
- Subject: C++, Unix and Bus Errors
- Date: 14 Feb 1996 16:43:06 -0800
- Organization: Megatek Corporation, San Diego, California
- Distribution: usa
- Message-ID: <4ftviq$3op@kelly.megatek.com>
- NNTP-Posting-Host: kelly.megatek.com
-
-
- Hi,
-
- My department is migrating from C to C++. I'm
- having problems trying to cleanly handle a bus
- error. With C, we just used setjmp()/longjmp()
- and everything worked just fine. However, in
- C++, the longjmp doesn't return to where the
- setjmp() was called. So, I tried to wrap the
- whole thing in a try-catch handler, with the
- throw being in a regular function that acts
- as the signal handler. The first time I get
- a bus error, things are handled just fine. The
- throw comes back to the corresponding catch and
- things are cool. However, the second and subsequent
- times that a bus error occurs, it is as if the
- signal handler was ignored.
-
- I tried to re-nominate the signal handler in the
- catch block, but that didn't work.
-
- Anybody have any ideas on how to get this to work?
-
- BTW, I also want to do a similar thing to handle
- segv, control-c, and alarms.
-
-
- Thanks,
-
- Tim
-
- --
- Tim Dietz
- tpd@megatek.com
-